Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Connection examples
The following code examples show how a client application specifies the connection and application arguments to connect an AppServer or application service.
Connecting to a session-managed AppServer
In this session-managed connection example, the
-AppService,-H, and-Sparameters are passed as theconnection-parametersargument to theCONNECT( )method. Specificuseridandpasswordvalues are also passed as connection arguments. A value is not supplied for theappserver-infoargument, as shown:
This code tries to connect an AppServer that supports the application service,
inventory. It sends its connection request to a NameServer that runs on a machine with the host name,zeusand is listening on UDP port 5162.When the
Note: The previous code example, and all remaining code examples in this chapter, are presented in simplified form for discussion purposes. In actual practice, you might use the Parameter File (CONNECT( )method executes, the NameServer provides the location of an AppServer broker to the client that supports theinventoryapplication service. The NameServer chooses the AppServer broker randomly from among all AppServers that support the application service and according to load balance settings (if any) established for the application service. The client then connects to the broker, passing the last two method arguments as the first two parameters of the AppServer Connect procedure. The client passes a value of"SMITH"foruseridand"STARSHIP"forpassword. It passes the Unknown value (?) forappserver-infobecause a value is not supplied for it.-pf) parameter as theconnection-parametersargument and variables to store theuseridandpassword(probably encrypted).Connecting to a session-free AppServer
In this session-free connection example, the
connection-parametersargument to theCONNECT( )method contains the-AppService,-H,-S,-sessionModel, and-initialConnectionsparameters, as shown:
This code tries to connect the
inventoryapplication service by setting up an initial connection pool containing 25 physical connections to AppServers that support this application service. It sends its connection request to a NameServer that runs on a machine with the host name,4glservicesand is listening on UDP port 5163. When theCONNECT( )method executes, the NameServer returns the location of an AppServer broker that supports theinventoryapplication service, once for each of the 25 requested physical connections. The client then creates the 25 physical connections to these brokers, distributed randomly and according to load balance settings (if any) established for the application service.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |